package button

import (
	"yunj/pkg/yunj/core/builder/form"
)

// 自定义按钮
type Custom struct {
	form.Button
}

func NewCustom() *Custom {
	b := &Custom{}
	form.SetButtonInstance(&b.Button, b)
	return b
}

// 设置描述文字
func (b *Custom) SetText(text string) *Custom {
	b.Text = text
	return b
}

// 设置class
func (b *Custom) SetClass(class string) *Custom {
	b.Class = class
	return b
}

// 设置图标class
func (b *Custom) SetIcon(icon string) *Custom {
	b.Icon = icon
	return b
}

// 设置移动端下拉（移动端表单集成到下拉操作里）
func (b *Custom) SetMobileDropDown(yes bool) *Custom {
	b.MobileDropDown = yes
	return b
}

// 设置权限
func (b *Custom) SetAuth(auth string) *Custom {
	b.Auth = auth
	return b
}
